<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Client Account Detail Form</title>
<link rel="stylesheet" type="text/css" href="css/loginstyle.css"/>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/ddaccordion.js"></script>
<link rel="stylesheet" type="text/css" href="css/popup_css.css" />
<script type="text/javascript">
ddaccordion.init({
	headerclass: "submenuheader", 
	contentclass: "submenu", 
	revealtype: "click", 
	mouseoverdelay: 200, 
	collapseprev: true, 
	defaultexpanded: [], 
	onemustopen: false, 
	animatedefault: false, 
	persiststate: true, 
	toggleclass: ["", ""], 
	togglehtml: ["suffix", "<img src='images/plus.gif' class='statusicon' />", "<img src='images/minus.gif' class='statusicon' />"], 
	animatespeed: "fast", 
	oninit:function(headers, expandedindices){ 
	},
	onopenclose:function(header, index, state, isuseractivated){ 
	}
});

$(document).ready(function() {
		
		
		$('#close').click(function(){
		    parent.history.back();
		    return false;
		});
		
		$("#submit").click(function(event) { 
			var x=0;
			if(document.getElementById('unameErrorLable').innerHTML!="")
				{
				x=1;
				}
			if(document.getElementById('bnameErrorLable').innerHTML!="")
			{
				x=1;
				}
			if(document.getElementById('accnoErrorLable').innerHTML!="")
			{
				x=1;
				}
			if(document.getElementById('pcErrorLable').innerHTML!="")
			{
				x=1;
				}
			if(document.getElementById('obErrorLable').innerHTML!="")
			{
				x=1;
				}
			if(document.getElementById('brkgErrorLable').innerHTML!="")
			{
				x=1;
				}
			if(document.getElementById('clErrorLable').innerHTML!="")
			{
				x=1;
				}
			if(document.getElementById('mlErrorLable').innerHTML!="")
			{
				x=1;
				}
				if(document.getElementById('ifscErrorLable').innerHTML!="")
				{
					x=1;
					}
				if(x==0){
			var reqUrl="./user/account";
			var jsondata = JSON.stringify({ "userId":$("#userId").val(),"ifsc":$("#ifsc").val(),"bname":$("#bname").val(),
				"accno":$("#accno").val(),"pancard":$("#pancard").val(),"openbal":$("#openbal").val(),"brokage":$("#brokage").val(),
				"cashl":$("#cashl").val(),"marginl":$("#marginl").val(),"creditamt":$("#creditamt").val(),
				"debitamt":$("#debitamt").val(),"billno":$("#billno").val(),"chequeno":$("#chequeno").val(),"baddress":$("#baddress").val()});
			$.ajax(
			  {
			  type: "POST",
			  url: reqUrl,
			  dataType: "json",
			  contentType: 'application/json',  
			  data:jsondata, 
			  success: function(jsonResponse) { 
				  alert(jsonResponse["msg"]);
				  document.getElementById("userId").value="";
				  document.getElementById("ifsc").value="";
				  document.getElementById("bname").value="";
				  document.getElementById("accno").value="";
				  document.getElementById("pancard").value="";
				  document.getElementById("openbal").value="";
				  document.getElementById("brokage").value="";
				  document.getElementById("cashl").value="";
				  document.getElementById("marginl").value="";
				  document.getElementById("creditamt").value="";
				  document.getElementById("debitamt").value="";
				  document.getElementById("billno").value="";
				  document.getElementById("chequeno").value="";
				  document.getElementById("baddress").value="";  
			  }
			});
				}
		});
		
	});	

function enter()
	{
	location.href = "clientpage.html";
	}
	
function formvalidation(){
	var error	=	false;
	document.getElementById('unameErrorLable').innerHTML="";
	document.getElementById('bnameErrorLable').innerHTML="";
	document.getElementById('accnoErrorLable').innerHTML="";
	document.getElementById('pcErrorLable').innerHTML="";
	document.getElementById('obErrorLable').innerHTML="";
	document.getElementById('brkgErrorLable').innerHTML="";
	document.getElementById('clErrorLable').innerHTML="";
	document.getElementById('mlErrorLable').innerHTML="";
	document.getElementById('ifscErrorLable').innerHTML="";
		if((document.getElementById('userId').value)==''){
			document.getElementById('unameErrorLable').innerHTML='*Enter UserId .';
			error	=	true;
		}
		
		 if((document.getElementById('bname').value)==''){
			document.getElementById('bnameErrorLable').innerHTML='*Enter  Bank Name.';
			error	=	true;
		}
		
			if((document.getElementById('accno').value)==''){
			document.getElementById('accnoErrorLable').innerHTML='*Enter Account Name.';
			error	=	true;
		}
			if((document.getElementById('pancard').value)==''){
				document.getElementById('pcErrorLable').innerHTML='*Enter Pan Card Number.';
				error	=	true;
			}
			if((document.getElementById('openbal').value)==''){
				document.getElementById('obErrorLable').innerHTML='*Enter  Opening Balance.';
				error	=	true;
			}
			if((document.getElementById('brokage').value)==''){
				document.getElementById('brkgErrorLable').innerHTML='*Enter Brokage.';
				error	=	true;
			}
			if((document.getElementById('cashl').value)==''){
				document.getElementById('clErrorLable').innerHTML='*Enter CashLimit.';
				error	=	true;
			}
			if((document.getElementById('marginl').value)==''){
				document.getElementById('mlErrorLable').innerHTML='*Enter Margin Limit.';
				error	=	true;
			}
			if((document.getElementById('ifsc').value)==''){
				document.getElementById('ifscErrorLable').innerHTML='*Enter IFSC CODE of your Bank.';
				error	=	true;
			}
			
		if(error==false){
			return true;
			}else{ 
			return false;
		}
}

function isNumberKey(evt){
var charCode = (evt.which) ? evt.which : event.keyCode;
if (charCode > 31 && (charCode < 48 || charCode > 57))
    return false;
return true;
}

</script>
<!-- 
<script language="javascript" type="text/javascript" src="js/niceforms.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="css/niceforms-default.css" />
 -->
<style>
.reg_form{
width:700px;
height:600px;
background:#fff;
margin:20px 0 0 145px;
float:left;
padding:0px 0 0 0px;
border-radius:10px;
}

.signup{width:96%; float:left; margin:2% 0 0 4%;}

.signup-1{width:94%; float:left; margin-top:22px; margin-bottom:25px; }

.signup-1left{width:189px; float:left; border-radius:5px; height:25px;}

.signup-1middle{width:167px; float:left; border-radius:5px; height:25px; margin-left:21px;}

.signup-1right{width:200px; float:right; border-radius:5px; height:25px;}

textarea, .inputtext, .inputpassword {
    border: 1px solid #BDC7D8;
    margin: 0;
    padding: 3px;
}

.signup-2{margin-top:5px; float:left;}
.signup-21{margin-top:23px; float:left;}

.signup-3{width:94%; float:left; margin:22px 0px 15px 0px;}
.signup-31{width:94%; float:left; margin:14px 0px 15px 0px;}
.signup-32{width:94%; float:left; margin:14px 0px 15px 0px;}

.signup-3left{width:150px; float:left; border-radius:5px; height:25px;}

.signup-3right{width:150px; float:left; border-radius:5px; height:25px; margin-left:174px;}

.signup-33{width:94%; float:left; margin:3px 0px 15px 0px;}

.signup-33left{width:150px; float:left; border-radius:5px; height:25px;}

.signup-33right{width:150px; float:left; border-radius:5px; height:25px; margin-left:174px;}

.signup-3-input{width:296px; float:left; border-radius:5px; height:25px;}

.signup-2-input{width:620px; float:left; border-radius:5px; height:25px;}

.join_5 {
    float: right;
    margin-right: 5px;
    width: 200px;
}

.join_3 {
    float: left;
    margin-bottom: 0px;
    margin-top: 10px;
    width: 306px;
}

.join_4 {
    float: left;
    font-size: 14px;
    margin-left: 5px;
    margin-top: 3px;
    text-align: left;
    width: 90px;
	color:#646262;
	font-weight:600;
}

.signup-4{width:99%; float:left; margin-top:15px;}

.signup-button{float:left; width:500px; margin-top:3%;}
.button{background: linear-gradient(#67AE55, #578843) repeat scroll 0 0 #69A74E; border-color: #3B6E22 #3B6E22 #2C5115; box-shadow: 0 1px 1px #A4E388 inset; padding:8px 0px; float:left; width:150px; border-radius:5px; text-align:center; color:#FFFFFF; font-size:18px; font-weight:bold;}

.text-area{width:94%; float:left; border:1px #CCCCCC solid;}
</style>
 
</head>
<body>

<div id="main_container">

	<div class="header_login">
    <div class="logo"><a href="#"><img src="img/ncmx-logo.png" alt="" title="" border="0" width="200" height="70"/></a></div>
    
    </div>
    
         <div class="reg_form">
         
         <h3>Client Account Detail Form</h3>
         <form id="account" method="post" action="./account">  
         <div class="signup">
         
         <div class="signup-2">
        <input name="userId" type="text" value="" maxlength="320" id="userId" placeholder="CLient ID" required class="signup-2-input" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" />
                <div id="unameErrorLable"></div>   
		</div>
        
        <div class="signup-1">
                <div class="signup-1left">
        		<input name="bname" type="text" value="" maxlength="170" id="bname" placeholder="Bank Name" required class="signup-1left" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" />
               	<div id="bnameErrorLable"></div> 
        		</div>
                
       			<div class="signup-1middle">
       			<input name="accno" type="text" value="" maxlength="170" id="accno" placeholder="Account Number" required class="signup-1left" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" onkeypress="return isNumberKey(event)"/>
       			<div id="accnoErrorLable"></div>
      			 </div>
                        
        		<div class="signup-1right">
        		 <input name="pancard" type="text" value="" maxlength="170" id="pancard" placeholder="Pan Card Number" required class="signup-1right" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;"/>
         		<div id="pcErrorLable"></div>
         		</div>
        </div>
                  
   
			<div class="signup-33">
			        <div class="signup-33left">
			          <input name="openbal" type="text" value="" maxlength="320" id="openbal" placeholder="Opening Balance" required class="signup-3-input" data-type="text" style='border:1px #c2bdbd solid; padding:2px 5px;' onkeypress="return isNumberKey(event)" />
			         <div id="obErrorLable"></div>
			 		 </div>
			                   
			        <div class="signup-33right">
			           <input name="ifsc" type="text" value="" maxlength="320" id="ifsc" placeholder="Bank IFSC Code" required  class="signup-3-input" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" />
			           <div id="ifscErrorLable"></div>
			         </div>  
			         </div>          

                   <div class="signup-21">
       					 <input name="brokage" type="text" value="" maxlength="320" id="brokage" placeholder="Brokage Detail"  required class="signup-2-input" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;"  />
                   <div id="brkgErrorLable"></div>
                   </div>
  <div class="signup-3">
        <div class="signup-3left">
          <input name="cashl" type="text" value="" maxlength="320" id="cashl" placeholder="Cash Limit" required class="signup-3-input" data-type="text" style='border:1px #c2bdbd solid; padding:2px 5px;' onkeypress="return isNumberKey(event)" />
         <div id="clErrorLable"></div>
 		 </div>
                   
        <div class="signup-3right">
           <input name="marginl" type="text" value="" maxlength="320" id="marginl" placeholder="Margin Limit" required  class="signup-3-input" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" onkeypress="return isNumberKey(event)"/>
           <div id="mlErrorLable"></div>
         </div>
 </div>  
 <div class="signup-31">
    <div class="signup-3left">
      <input name="creditamt" type="text" value="" maxlength="320" id="creditamt" placeholder="Credit Amount"  class="signup-3-input" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" onkeypress="return isNumberKey(event)"/>
      </div>
                   
     <div class="signup-3right">
       <input name="debitamt" type="text" value="" maxlength="320" id="debitamt" placeholder="Debit Amount"  class="signup-3-input" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" onkeypress="return isNumberKey(event)" />
             </div>
 </div>
                   
  <div class="signup-32">
      <div class="signup-3left">
        <input name="billno" type="text" value="" maxlength="320" id="billno" placeholder="Bill Number"  class="signup-3-input" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" onkeypress="return isNumberKey(event)" />
      
   </div>               
  <div class="signup-3right">
     <input name="chequeno" type="text" value="" maxlength="320" id="chequeno" placeholder="Cheque Number"  class="signup-3-input" data-type="text" style="border:1px #c2bdbd solid; padding:2px 5px;" onkeypress="return isNumberKey(event)" />
   </div>
  </div>
         &nbsp;
  <br/>
  <div class="signup-4">
   	<textarea name="baddress" id="baddress" class="text-area" placeholder="Bank Address" style="border-radius:5px;"></textarea>
   </div>
   <br/>
   	<div class="signup-button">
   <input class="button" type="button" name="submit" id="submit" value="Register" onclick="formvalidation();"></input>
  </div>                     
  </div>
  <a class="close" href="#" id="close" style=" right: 281px; top: 126px;"></a>    
  </form>
         </div>  
    <div class="footer_login">    
    	<div class="left_footer_login"> <a href="#"></a></div>
    	<div class="right_footer_login"><a href="#"></a></div>
    </div>
</div>		
</body>
</html>
